package RemoteEx;
import java.net.*;
import java.io.*;

public class SimpleClient {
	public final int sPORT=2016;
	//public String endflag="/r/n";
	public Socket s;
	public DataOutputStream dout;
	public boolean conn;
	public int SetUp()
	{
		try{
		s=new Socket("192.168.1.105",sPORT);
		if(s.isConnected())
		{
			System.out.println(s.getInetAddress().toString());
			conn=true;
			return 1;
		}
		}catch(Exception e)
		{
			System.out.println(e.getStackTrace()+"/setup");
		}
		return 0;
	}
	
	public void SendCom(String str)
	{
		if(s.isConnected())
		{
			try{
			dout=new DataOutputStream(s.getOutputStream());
			dout.writeUTF(str);
			//dout.writeUTF(endflag);		
			}catch(Exception e)
			{
				System.out.println(e.getStackTrace()+"/sendcom");
			}
		}
	}

}
